from datetime import datetime
import pytz

def comp(t1, t2):
  utc=pytz.UTC
  if t1.tzinfo is None:
    t1 = utc.localize(t1) 
  if t2.tzinfo is None:
    t2 = utc.localize(t2) 
    
  if t1 > t2:
    return 1
  if t1 == t2:
    return 0 
  if t1 < t2:
    return -1

def expired(t1):
  t2 = datetime.now(tz=pytz.timezone("Asia/Shanghai"))
  return comp(t1, t2) <= 0